#include"abonne.h"
#include<iostream>

	void Abonne:: saisir()
	{
	cout<<"donner le nom le prenom le numero le cin le solde:"<<endl;
	cin>>nom>>prenom>>numero>>CIN>>solde;
	}

	void Abonne::afficher()
	{ 
	cout<<"Nom:"<<nom<<"\n";
	cout<<"Prenom:"<<prenom<<"\n";
	cout<<"le numero:"<<numero<<endl;
	cout<<"CIN:"<<cin<<"\n";
	cout<<"le solde:"<<solde<<"\n";
	
	}

	void Abonne::recharger(float sold)
	{ 
	solde=solde+sold;
 	}

	bool Abonne::consommer(int sec,float prix)
	{
	
	float som;
	som=sec*prix;
	if(som>solde)
 		{
		cout<<"le solde est insuffisant:"<<endl;
		return false;
		}
	else
		{
		solde=solde-som;
		cout<<"le nouveau solde est:"<<solde<<endl;
                return true;
		}
	 }
	Abonne:: Abonne(string nom,string prenom,int num,int CIN,float sold)
 
	{
	nom=nom;
	numero=num;
 	CIN=CIN;
 	solde=sold;
 	}
	 Abonne::Abonne()
	{nom="thabet";
	prenom="dalel";
	numero=12;
	CIN=265;
	solde=435;
	}
 
